package service

import (
	"seat-service/model"
	"seat-service/model/dto"
)

type Casbin interface {
	CreateUser(userCode int, role string, ordered int, status int) error                                       //创建用户
	SelectRoles(condition dto.PageParam) (err error, rolesInformation []model.CasbinRuleExtended, total int64) //获取所有角色
	SelectRoleById(id int) (role model.CasbinRuleExtended, err error)                                          //根据id 查询角色信息
	ChangeRoleById(newRoleInformation dto.ChangeRole) (role model.CasbinRuleExtended, err error)               //根据id , 修改角色信息
	DeleteRoleByIds(ids []int) (err error)                                                                     //批量删除角色
	Allocate(ruleIds dto.RuleID) (err error)                                                                   //分配权限
	GetRoleName(roleId int) (roleName []model.CasbinRuleExtended, err error)                                   //根据角色id,查询角色名称
	CheckControl(roleName string, menuId int) (isControl bool, err error)                                      //根据角色名称 和 菜单id , 查询角色是否有菜单权限
}
